package it.infodea.tapestrydea.support.enumerations;

public enum SecurityGroup {
	ADMIN(0), SUPERVISOR(1), SECRETARY(2), VISOR(3), USER(4), EXTERNAL(5), ANONYMOUS(6);

	private int level;

	SecurityGroup(int level) {
		this.level = level;
	}

	public int getLevel() {
		return level;
	}

	public static SecurityGroup getByLevel(int level) {
		for (SecurityGroup item : values()) {
			if (item.getLevel() == level)
				return item;
		}
		return null;
	}
}
